package com.phospherus.flow.controller

import com.phospherus.common.controller.BaseSaveController
import com.phospherus.common.controller.handler.ResultHandler
import com.phospherus.flow.entity.FlowNode
import com.phospherus.flow.service.FlowNodeService
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody

/**
 * @author songjinlong
 * @version 1.0
 * @since 2017/11/10
 */
@Controller
@RequestMapping("/flow/flowNode")
class FlowNodeController : BaseSaveController<FlowNode, FlowNodeService>() {
    @RequestMapping("/nextNodes")
    @ResponseBody
    fun nextNodes(flowId:Long,currNodeId: Long?) = ResultHandler(ResultHandler.SystemMessage.SUCCESS, service.getChildrenNodes(flowId,currNodeId))
}